/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.gui;

import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JOptionPane;

import org.hibernate.type.TextType;

import com.metier.UsersMetier;

/**
 * 
 * @author Mamadou
 */
public class PanelAjoutConsultant extends javax.swing.JPanel {
	// Variables declaration - do not modify//GEN-BEGIN:variables
   
    private javax.swing.JButton boutonValider;
    private javax.swing.JButton boutonAnnuler;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    

	private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTextArea textAdresse;
    private javax.swing.JTextField textEmail;
    private javax.swing.JTextField textLogin;
    private javax.swing.JTextField textNom;
    private javax.swing.JPasswordField textPassword;
    private javax.swing.JTextField textPhone;
    private javax.swing.JTextField textPrenom;
    private javax.swing.JComboBox textProfil;
    private String valeureSelectionner;
    UsersMetier userMetier;
    // End of variables declaration//GEN-END:variables


	/**
	 * Creates new form PanelAjoutConsultant
	 */
	public PanelAjoutConsultant() {
		userMetier=new UsersMetier();
		
		
		initComponents();
	}

	/**
	 * This method is called from within the constructor to initialize the form.
	 * WARNING: Do NOT modify this code. The content of this method is always
	 * regenerated by the Form Editor.
	 */
	@SuppressWarnings("unchecked")
	
    private void initComponents() {

        jPanel2 = new javax.swing.JPanel();
                jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        textNom = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        textPrenom = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        textLogin = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        textPassword = new javax.swing.JPasswordField();
        jLabel5 = new javax.swing.JLabel();
        textEmail = new javax.swing.JTextField();
        jLabel6 = new javax.swing.JLabel();
        textPhone = new javax.swing.JTextField();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        textAdresse = new javax.swing.JTextArea();
        jLabel10 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        textProfil = new javax.swing.JComboBox();
        boutonValider = new javax.swing.JButton();
        boutonAnnuler = new javax.swing.JButton();
        textProfil.addActionListener(new ActionListener() {
			
			public void actionPerformed(ActionEvent arg0) {
				// TODO Auto-generated method stub
				Object source = textProfil.getSelectedItem();
				valeureSelectionner= (String) source;
				
			}
		});
     boutonValider.addActionListener(new ActionListener() {
		
		
		public void actionPerformed(ActionEvent arg0) {
			// TODO Auto-generated method stub
			userMetier.addUsersMetier(textNom.getText(), textPrenom.getText(), textLogin.getText(), textEmail.getText(), textPassword.getText(), textPhone.getText(), valeureSelectionner, textAdresse.getText());
			
			JOptionPane.showMessageDialog(null, "user saved");
		}
	});
     boutonAnnuler.addActionListener(new ActionListener() {
		
		
		public void actionPerformed(ActionEvent e) {
			// TODO Auto-generated method stub
			textNom.setText("");
			textPrenom.setText("");
			textAdresse.setText("");
			textEmail.setText("");
			textLogin.setText("");
			textPhone.setText("");
			
		}
	});
        setBackground(new java.awt.Color(223, 242, 255));
        setBorder(javax.swing.BorderFactory.createMatteBorder(1, 1, 1, 1, new java.awt.Color(103, 153, 255)));
        setMaximumSize(new java.awt.Dimension(743, 318));
        setPreferredSize(new java.awt.Dimension(742, 303));

        jPanel1.setFont(new java.awt.Font("Verdana", 3, 14)); // NOI18N
        jPanel1.setPreferredSize(new java.awt.Dimension(741, 267));

        jLabel1.setFont(new java.awt.Font("Verdana", 3, 14)); // NOI18N
        jLabel1.setText("Nom");

        jLabel2.setFont(new java.awt.Font("Verdana", 3, 14)); // NOI18N
        jLabel2.setText("Prenom");

        jLabel3.setFont(new java.awt.Font("Verdana", 3, 14)); // NOI18N
        jLabel3.setText("Login");

        jLabel4.setFont(new java.awt.Font("Verdana", 3, 14)); // NOI18N
        jLabel4.setText("Password");

        textPassword.setEditable(false);
        textPassword.setText("passer");

        jLabel5.setFont(new java.awt.Font("Verdana", 3, 14)); // NOI18N
        jLabel5.setText("Email");

        jLabel6.setFont(new java.awt.Font("Verdana", 3, 14)); // NOI18N
        jLabel6.setText("Phone");

        jLabel7.setFont(new java.awt.Font("Verdana", 3, 14)); // NOI18N
        jLabel7.setText("Profil");

        jLabel8.setFont(new java.awt.Font("Verdana", 3, 14)); // NOI18N
        jLabel8.setText("Adresse");

        textAdresse.setColumns(20);
        textAdresse.setFont(new java.awt.Font("Verdana", 3, 14)); // NOI18N
        textAdresse.setRows(5);
        jScrollPane1.setViewportView(textAdresse);

        jLabel10.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/photos/profil.gif"))); // NOI18N

        jLabel9.setFont(new java.awt.Font("Verdana", 3, 14)); // NOI18N
        jLabel9.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel9.setText("Photo Profil");

        textProfil.setFont(new java.awt.Font("Verdana", 3, 12)); // NOI18N
        textProfil.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Administrateur", "Consultant", "Comptable", "Agent Commercial" }));

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(118, 118, 118)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(textNom)
                            .addComponent(textPrenom)
                            .addComponent(textLogin)
                            .addComponent(textPassword, javax.swing.GroupLayout.DEFAULT_SIZE, 162, Short.MAX_VALUE)
                            .addComponent(textEmail)
                            .addComponent(textPhone)))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(jLabel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jLabel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jLabel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, 100, Short.MAX_VALUE)
                            .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addGap(18, 18, 18)
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 162, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(textProfil, javax.swing.GroupLayout.PREFERRED_SIZE, 162, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(18, 275, Short.MAX_VALUE)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel10)
                        .addGap(18, 18, 18))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 132, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(38, 38, 38))))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, 178, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(5, 5, 5)
                        .addComponent(jLabel9)
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(textNom, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel1))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel2)
                            .addComponent(textPrenom, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel3)
                            .addComponent(textLogin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel4)
                            .addComponent(textPassword, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel5)
                            .addComponent(textEmail, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel6)
                            .addComponent(textPhone, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel8)
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel7)
                            .addComponent(textProfil, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
        );

        boutonValider.setFont(new java.awt.Font("Verdana", 3, 14)); // NOI18N
        boutonValider.setText("VALIDER");

        boutonAnnuler.setFont(new java.awt.Font("Verdana", 3, 14)); // NOI18N
        boutonAnnuler.setText("ANNULER");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 743, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addGroup(layout.createSequentialGroup()
                .addGap(239, 239, 239)
                .addComponent(boutonValider)
                .addGap(68, 68, 68)
                .addComponent(boutonAnnuler))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(boutonValider)
                    .addComponent(boutonAnnuler))
                .addContainerGap(30, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents
    
	/**
	 * @return the textAdresse
	 */
	public javax.swing.JTextArea getTextAdresse() {
		return textAdresse;
	}

	/**
	 * @param textAdresse the textAdresse to set
	 */
	public void setTextAdresse(javax.swing.JTextArea textAdresse) {
		this.textAdresse = textAdresse;
	}

	/**
	 * @return the textEmail
	 */
	public javax.swing.JTextField getTextEmail() {
		return textEmail;
	}

	/**
	 * @param textEmail the textEmail to set
	 */
	public void setTextEmail(javax.swing.JTextField textEmail) {
		this.textEmail = textEmail;
	}

	/**
	 * @return the textLogin
	 */
	public javax.swing.JTextField getTextLogin() {
		return textLogin;
	}

	/**
	 * @param textLogin the textLogin to set
	 */
	public void setTextLogin(javax.swing.JTextField textLogin) {
		this.textLogin = textLogin;
	}

	/**
	 * @return the textNom
	 */
	public javax.swing.JTextField getTextNom() {
		return textNom;
	}

	/**
	 * @param textNom the textNom to set
	 */
	public void setTextNom(javax.swing.JTextField textNom) {
		this.textNom = textNom;
	}

	/**
	 * @return the textPassword
	 */
	public javax.swing.JPasswordField getTextPassword() {
		return textPassword;
	}

	/**
	 * @param textPassword the textPassword to set
	 */
	public void setTextPassword(javax.swing.JPasswordField textPassword) {
		this.textPassword = textPassword;
	}

	/**
	 * @return the textPhone
	 */
	public javax.swing.JTextField getTextPhone() {
		return textPhone;
	}

	/**
	 * @param textPhone the textPhone to set
	 */
	public void setTextPhone(javax.swing.JTextField textPhone) {
		this.textPhone = textPhone;
	}

	/**
	 * @return the textPrenom
	 */
	public javax.swing.JTextField getTextPrenom() {
		return textPrenom;
	}

	/**
	 * @param textPrenom the textPrenom to set
	 */
	public void setTextPrenom(javax.swing.JTextField textPrenom) {
		this.textPrenom = textPrenom;
	}

	/**
	 * @return the textProfil
	 */
	public javax.swing.JComboBox getTextProfil() {
		return textProfil;
	}

	/**
	 * @param textProfil the textProfil to set
	 */
	public void setTextProfil(@SuppressWarnings("rawtypes") javax.swing.JComboBox textProfil) {
		this.textProfil = textProfil;
	}
	public javax.swing.JButton getBoutonValider() {
		return boutonValider;
	}

	public void setBoutonValider(javax.swing.JButton boutonValider) {
		this.boutonValider = boutonValider;
	}

	public javax.swing.JButton getBoutonAnnuler() {
		return boutonAnnuler;
	}

	public void setBoutonAnnuler(javax.swing.JButton boutonAnnuler) {
		this.boutonAnnuler = boutonAnnuler;
	}
		
	
	
	
	
}
